package com.smartfast4j.common;

import org.apache.log4j.Logger;

import java.util.ResourceBundle;

/**
 * 系统公共配置类
 * @author xdp
 *
 */
public final class SystemConfig {

	//log4j日志打印器
	private static final Logger logger = Logger.getLogger(SystemConfig.class);

	/**
	 * 加载系统公共配置文件
	 */
	private static final ResourceBundle sFtpResourceBundle = ResourceBundle.getBundle("config/sFtpConfig");
	private static final ResourceBundle qiniuResourceBundle = ResourceBundle.getBundle("config/qiniuConfig");

	/**
	 * 七牛文件服务器域名
	 */
	public static final String QINIU_FILE_SERVER_DOMAIN = qiniuResourceBundle.getString("qiniu.server.domain");

	/**
	 * 常量类不允许实例化
	 */
	private SystemConfig(){

	}

	/**
	 * SFTP服务器相关配置项
	 */
	public static final class SFTP{
		/**
		 * SFTP服务器IP地址
		 */
		public static final String SFTP_SERVER_IP = sFtpResourceBundle.getString("sftp.server.ip");
		/**
		 * SFTP服务器用户名
		 */
		public static final String SFTP_SERVER_USERNAME = sFtpResourceBundle.getString("sftp.server.username");
		/**
		 * SFTP服务器密码
		 */
		public static final String SFTP_SERVER_PASSWORD = sFtpResourceBundle.getString("sftp.server.password");
		/**
		 * SFTP服务器根目录
		 */
		public static final String SFTP_SERVER_WORKING_PATH = sFtpResourceBundle.getString("sftp.server.workingPath");
		/**
		 * SFTP服务器连接端口号
		 */
		public static final String SFTP_SERVER_PORT = sFtpResourceBundle.getString("sftp.server.port");
		/**
		 * FTP文件服务器IP(域名)
		 */
		public static final String SFTP_SERVER_DOMAIN = sFtpResourceBundle.getString("sftp.server.domain");

	}

	/**
	 * 七牛云存储配置
	 */
	public static final class QiNiu{
		public static final String AK = qiniuResourceBundle.getString("qiniu.ak");
		public static final String SK = qiniuResourceBundle.getString("qiniu.sk");
		public static final String BUCKET = qiniuResourceBundle.getString("qiniu.bucket");

	}
}
